#ifndef __GKOS_BITMAP_H
#define __GKOS_BITMAP_H

#include "lib/global.h"
typedef uint8_t* ptr8_t;

struct bitmap_struct{
    uint32_t size;
    ptr_t    bits;
};
typedef struct bitmap_struct bitmap;

/*
* Function: InitBitmap
* Return: void
* ----------------------------------------------------
* 初始化整个位图，将其中所有位均置为0
*/
void InitBitmap(bitmap* dstBitmap, uint32_t size, ptr_t bits);
/*
* Function: GetMemBlock
* Return: 要返回的块的编号
* ----------------------------------------------------
* 
*/
uint32_t GetBitsBlock(bitmap* dstBitmap, uint32_t blockSize);

void FreeBitsBlock(bitmap* dstBitmap, uint32_t blockstart, uint32_t blocksize);

void SetBits(bitmap* dstBitmap, uint32_t blockstart, uint32_t blocksize);
void ClearBits(bitmap* dstBitmap, uint32_t blockstart, uint32_t blocksize);
#endif